GtkStyle: Do not warn if attach count == 0
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Nov 2010 00:11:26 +0000 (01:11 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:39 +0000 (15:39 +0100)
This is going go happen more and more often now, as realize handlers start
removing the gtk_widget_style_attach() calls.

gtk/gtkstyle.c

index 1d07ddf52026c5a08677134f152a7b96b4599494..cdd12491c64f9edc08f186cc19f29a63d9274589 100644 (file)
@@ -954,8 +954,10 @@ void
 gtk_style_detach (GtkStyle *style)
 {
   g_return_if_fail (GTK_IS_STYLE (style));
-  g_return_if_fail (style->attach_count > 0);
-  
+
+  if (style->attach_count == 0)
+    return;
+
   style->attach_count -= 1;
   if (style->attach_count == 0)
     {